package com.xidian.zhiancloud.service.myyb;

import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xidian.zhiancloud.dao.SysMenuMapper;
import com.xidian.zhiancloud.model.SysMenu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.*;

/**
 * 菜单管理
 *
 * @author
 */
@Service
public class ISysMenuService extends ServiceImpl<SysMenuMapper, SysMenu> implements IService<SysMenu> {

    @Autowired
    private SysMenuMapper sysMenuMapper;
    @Autowired
    private ISysUserService sysUserService;

    public List<SysMenu> queryNotButtonList() {
        return sysMenuMapper.queryNotButtonList();
    }

    public SysMenu queryObject(String menuId) {
        return sysMenuMapper.selectById(menuId);
    }

    public List<SysMenu> queryList(Map<String, Object> params) {
        return sysMenuMapper.queryList(params);
    }

    public List<SysMenu> queryList(Integer pid,Integer roleId) {
        return sysMenuMapper.queryList(pid,roleId);
    }

    public int queryTotal(Map<String, Object> map) {
        return sysMenuMapper.queryTotal(map);
    }

    @Transactional
    public int deleteBatch(String[] menuIds) {
        return sysMenuMapper.deleteBatchIds(Arrays.asList(menuIds));
    }

}
